home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 1
/
001.d81
/
decision maker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
4KB
|
144 lines
100 print"[147]":gosub10000
200 rem a decision maker
300 :
400 dimf$(10),l$(10),f(10),m(10,10),v(10),z(10):print
600 print"[147]":print
700 printtab(3)"*** computerized decision-maker ***"
800 print:print
900 y$="y":print" i can help you make decisions by"
1000 print"choosing the best possibility for you"
1100 print"out of several alternatives."
1200 print
1300 print"all i need to do is organize informationyou already have."
1400 print
1405 print" which of these best describes the typeof decision you have to make?
1410 [153]
1500 [153]"1-choose an item from several alternatives."
1600 [153]"2-choose a course of action from several alternatives."
1700 [153]:[153]"which type(1 or 2) choice do you have to make":[133]c
1800 [139]c[179]1[176]c[177]2[167]1700
1900 [153]:[139]c[178]1[167][153]" what type of item is it that you "
2000 [139]c[178]1[167][153]"need to decide upon?":[133]s$
2100 [139]c[178]2[167]s$[178]"course of action"
2200 [153]:[153]"i will now need a list of each ":[153]s$;
2300 [153]" that you are ":[153]"considering. please input";
2400 [153]" them one":[153]"at a time. the order is"
2500 [153]"of no particular importance.":[153]
2608 [133]"first, how many are there altogether";l0
2700 [139]l0[177][178]2[175]l0[179][178]10[167]2900
2800 [141]9700:[137]2608
2900 [153]:[129]i[178]1[164]l0:[153]:[153]"number ";i;", please."
3000 [133]l$(i):[130]i:[153]
3100 [153]"o.k., this is the list under considera- tion":[153]
3200 [129]i[178]1[164]l0:[153]i;[163]5);l$(i):[130]i:[153]:[141]9800
3300 [139]b$[179][177]y$[167]2200
3400 [153]:[153]" now, how many different factors are"
3500 [153]"important to you in choosing a ";s$;"?":[133]f0
3600 [139]f0[177]1[175]f0[179]10[167]3800
3700 [141]9700:[137]3400
3800 [153]:[153]" i need a list of each of these factors "
3900 [129]i[178]1[164]f0:[153]:[153]"factor number ";i:[133]f$(i):[130]
4000 [153]"load"
4100 [153]:[153]" now look at the following list of"
4200 [153]"factors you have provided and decide"
4300 [153]"which is the most important to you:"
4400 [153]:[129]i[178]1[164]f0:[153]i;[163]5);f$(i):[130]
4500 [153]:[153]"which factor(by number)is most important"
4600 [153]"(input 0 if you wish to change the list) ":[133]f2
4700 [139]f2[178]0[167]3400
4800 [139]f2[179]1[176]f2[177]f0[167]4500
4900 [153]:[153]" o.k., suppose we have a scale of"
5000 [153]"importance that ranges from 0 to 10."
5100 [153]"let's say ";f$(f2);" has a value of 10,"
5200 [153]"since it is at the top of the scale/"
5300 [153]"on this scale, what value would"
5400 [153]"each of the other factors have?"
5500 [153]" (decimal numbers are o.k.)":[153]:[129]i[178]1[164]f0
5600 [139]i[178]f2[167]5900
5700 [153]f$(i):[133]f(i):[139]f(i)[177]0[175]f(i)[179][178]10[167]5900
5800 [153]" your input is no good. try again!":[137]5700
5900 [130]
5905 f(f2)[178]10
5910 c[178]0
5915 [129]i[178]1[164]f0
5920 c[178]c[170]f(i)
5925 [130]
5930 [129]i[178]1[164]f0
6000 f(i)[178]f(i)[173]c:[130]:[153]:[153]"now conider how each ";s$
6100 [153]"rates with respect to each of the"
6200 [153]"factors. we will consider each factor"
6300 [153]"separately and then rate each"
6400 [153]s$;" in terms of that factor"
6500 [153]"only.":[153]
6600 [153]"let's consider ";l$(1);" to have a"
6700 [153]"value of 10 on each scale."
6800 [153]"then every other ";s$
6900 [153]"will be given a number higher or lower"
7000 [153]"than 10 according to how much better"
7100 [153]"or worse than ";l$(1);" you think it is.":[129]i[178]1[164]f0:[153]
7200 [153]
7300 [153]"considering ";f$(i);" only, and"
7400 [153]"assuming ";l$(1);" has a value of 10,"
7500 [153]"what value would you give to each of thefollowing;"
7600 [153]:[129]j[178]2[164]l0
7700 [153]l$(j):[133]m(j,i):[139]m(j,i)[177][178]0[167]7900
7800 [153]" c'mon, no negative numbers! try again.":[137]7700
7900 [130]j
7905 [153]
7910 m(1,i)[178]10
7915 [130]i
7920 [129]i[178]1[164]f0
7925 c[178]0
7930 [129]j[178]1[164]l0
8000 c[178]c[170]m(j,i)
8005 [130]j
8010 [129]j[178]1[164]l0
8015 m(j,i)[178]m(j,i)[173]c
8020 [130]j
8025 [130]i
8100 [129]j[178]1[164]l0:v(j)[178]0:[129]i[178]1[164]f0:v(j)[178]v(j)[170]m(j,i)[172]f(i)
8200 [130]i
8205 [130]j
8210 [129]i[178]1[164]10
8215 z(i)[178]i
8220 [130]i
8225 c[178]l0[171]1
8230 [129]j[178]1[164]l0
8300 [129]i[178]1[164]c:n1[178]z(i):n2[178]z(i[170]1):[139]v(n1)[177]v(n2)[167]8500
8400 z(i[170]1)[178]n1:z(i)[178]n2
8500 [130]i:[130]j:c1[178]z(1):c2[178]z(2):c[178]100[173]v(c1):[129]j[178]1[164]l0
8600 v(j)[178]c[172]v(j):[130]:[153]:[153]:d[178]v(c1)[171]v(c2)
8700 [153]" well, you best choice seems to be "
8800 [153]l$(c1);", ";
8900 [139]d[179]10[167][153]"but it's very close."
9000 [139]d[179]20[175]d[177][178]10[167][153]"by a fair margin."
9100 [139]d[177][178]20[167][153]"by a good-sized margin."
9200 [153]:[153]"here's the final list with ";l$(c1)
9300 [153]"given a value of 100 and the others set accordingly:"
9400 [153]:[153]:[153]"rating ",s$:[129]j[178]1[164]l0:c[178]z(j)
9500 [153]
9600 [153][181](v(c)),l$(c):[130]
9605 [161]k$:[139] k$[178]""[167]9605
9610 [138]
9700 [153]" the number must be between 2 and 10":[142]
9800 [133]" is this correct (yes or no)?";a$
9900 b$[178][200](a$,1):[142]
10000 [153]"load";:[153]"decision maker"
10100 [153]:[153]
10200 [153]
10300 [153]:[153]:[153]"having a hard time making a decision?
10400 print"let your commodore help you"
10500 print"":print" press 'f1' to end"
10600 print"":print"< press the space bar to continue.>"
10700 poke190,0:poke198,1:geta$
10800 ifa$="[133]"then11005
10810 ifa$=" "thenprint"[147]":return
10820 goto10700
11005 print"[147]"
11010 print""
11015 print"";
11020 print"* * * the end * * *"
11021 print"load"chr$(34)"payload"chr$(34)",8":print"run"
11022 poke631,13:poke632,13:poke198,2
11025 end